using System;
using Picnic.Spec.Exceptions;
using Picnic.Spec.Utils;

namespace Picnic.Spec.Console.ExceptionWriters
{
	/// <summary>
	/// Represents a writer for <see cref="EqualsException"/>.
	/// </summary>
	public class EqualsExceptionWriter : AbstractExceptionWriter<EqualsException>
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="EqualsExceptionWriter"/> class.
		/// </summary>
		public EqualsExceptionWriter(ConsoleColor color = ConsoleColor.Red)
			: base(color)
		{
		}

		protected override void WriteException(IConsole console, EqualsException exception)
		{
			console.WriteLine("required and actual values are not equals");
			console.WriteLine("  required: " + FormatValue.AsString(exception.RequiredValue));
			console.WriteLine("  actual:   " + FormatValue.AsString(exception.ActualValue));
		}
	}
}